package pri.jz.keeper.webservice.entityT

import pri.jz.keeper.entity.User
import pri.jz.keeper.util.BitmapUtil
import java.util.Date

/**
 *Author by: JZ
 *Email: 2451756617@qq.com
 *PS:用户数据 用于数据传输
 */
data class UserT(
    val id: Int = -1,
    var number: String = "-1",
    var password: String = "-1",
    var name: String = "用户",
    var admin: Int = 0,//管理员权限 数字越大权限越高
    var sex: String = "外星人",//1：男，0：女
    var headIcon: String = "", //头像
    var lastLoginIP: String = "localhost", //上次登录IP
    var loginIP: String = "localhost", //本次登录IP
    var lastLoginDate: Date = Date(), //上次登录时间
    var lastLoginAddress: String = "北京市",
    var consumeAmount: Int = 0
    ) {
        fun toUser(): User = User(
            id, number, password, name, admin, sex,
            BitmapUtil.getBitmapFromS(headIcon),lastLoginIP,
            loginIP, lastLoginDate, lastLoginAddress,lastLoginDate,consumeAmount
        )
 }